<?php
/**
 * @package WordPress
 * @subpackage desire
 */
?>
<?php global $desireoptions; ?>
<div id="sidebar">
    <ul>
        <?php if(trim($desireoptions['adsense_code']) != ""): ?>
        <li id="widget-adsense" class="widget-container">
            <?php echo $desireoptions['adsense_code']; ?>
        </li>
        <?php endif; ?>
        <li id="widget-search" class="widget-container">
            <?php get_search_form(); ?>
        </li>
        <?php if(!dynamic_sidebar('desire-primary-widget-1')): ?>        
        <?php endif; ?>
        
        <?php if($desireoptions['show_tabbed_content']): ?>
        <li class="tabbed-content" id="desire-tabbed-content">
			<div class="sidebar-tab current" id="popular-posts-tab" onclick="toggle('popular-posts','recent-comments','tags')"><?php _e('Popular Posts','desire'); ?></div>
            <div class="sidebar-tab" id="recent-comments-tab" onclick="toggle('recent-comments','popular-posts','tags')"><?php _e('Comments','desire'); ?></div>
            <div class="sidebar-tab" id="tags-tab" onclick="toggle('tags','recent-comments','popular-posts')"><?php _e('Tags','desire'); ?></div>
            <div class="clear"></div>
            <div class="sidebar-tab-content" id="popular-posts">
                <ul><?php desire_popular_posts(); ?></ul>
            </div>
            <div class="sidebar-tab-content" id="recent-comments">
                <ul><?php desire_recent_comments(); ?></ul>
            </div>
            <div class="sidebar-tab-content" id="tags">
                <?php wp_tag_cloud(); ?>
            </div>
            <div class="clear"></div>
        </li>
        <?php endif; ?>
        
        <?php if(!dynamic_sidebar('desire-primary-widget-2')): ?>
            <li class="widget-container">
                <h3 class="widget-title"><?php _e('Archives','desire'); ?></h3>
                <ul><?php wp_get_archives('title_li='); ?></ul>
            </li>
            <li class="widget-container">
                <h3 class="widget-title"><?php _e('Recent Posts','desire'); ?></h3>
                <ul><?php wp_get_archives('title_li=&type=postbypost&limit=5'); ?></ul>
            </li>
            <li class="widget-container">
                <h3 class="widget-title"><?php _e('Categories','desire'); ?></h3>
                <ul><?php wp_list_categories('title_li=&hierarchical=1&depth=3'); ?></ul>
            </li>
        <?php endif; ?>
    </ul>
</div>